﻿using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using SimpleFS.Core;

namespace SimpleFS.Storage.Gzip
{
    public class File : IFile
    {
        protected string fileName;

        public File(string fileName)
        {
            this.fileName = fileName;
        }

        #region IFile Members

        public System.IO.Stream Read()
        {
            System.IO.FileStream fs 
                = System.IO.File.Open(ParentDirectory.Name, FileMode.Open);
            System.IO.Compression.GZipStream stream
                = new System.IO.Compression.GZipStream(fs, CompressionMode.Decompress);

            return stream;
        }

        public void Write(System.IO.Stream stream)
        {
            throw new NotImplementedException();
        }

        public string Extension
        {
            get { throw new NotImplementedException(); }
        }

        #endregion

        #region IFileSystemObject Members

        public string Name
        {
            get { throw new NotImplementedException(); }
        }

        public DateTime LastModifiedTime
        {
            get { throw new NotImplementedException(); }
        }

        public Dictionary<string, string> Attributes
        {
            get { throw new NotImplementedException(); }
        }

        public IDirectory ParentDirectory
        {
            get { throw new NotImplementedException(); }
        }

        public int Size
        {
            get { throw new NotImplementedException(); }
        }

        public void Copy(IFileSystemObject target)
        {
            throw new NotImplementedException();
        }

        public void Move(IFileSystemObject target)
        {
            throw new NotImplementedException();
        }

        public void Delete()
        {
            throw new NotImplementedException();
        }

        public bool Exists()
        {
            throw new NotImplementedException();
        }

        public void Rename(string newName)
        {
            throw new NotImplementedException();
        }

        public void Close()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
